#pragma once

#include <string>
#include <vector>
#include "sqlite3.h"
#include "userInfo.h"

class CSqlitTerm
{
private:
	sqlite3 *humanDB;
	sqlite3 *programDB;
	sqlite3 *pressureMoniterDB;

	std::string  humanDBFileName;
	std::string  programDBFileName;
	std::string  pressureMoniterDBFN;

	int TransferUtf8ToUnicode(char* utf8, TCHAR** unicode);
	int TransferUnicodeToUtf8(char** utf8, CString unicode);

public:
	CSqlitTerm();
	~CSqlitTerm();

	int OpenDB();
	int GetUserInfo(std::vector<UserInfo_S> &userInfo);
	int SetUserInfo(UserInfo_S &userInfo, int index);
	int GetProgramParameters(std::vector<ProgramParameter_s> &program);
	int SetProgramParameters(ProgramParameter_s &program, int num);
	int AddUser(UserInfo_S &userInfo);
	int UpdateUser(UserInfo_S &userInfo);
	int DeleteUser(UserInfo_S &userInfo);

	int CloseDB();
};

